package nl.runnable.solr.xslt;

import java.io.IOException;

import javax.xml.transform.Templates;

import org.apache.solr.common.util.ContentStream;
import org.apache.solr.request.SolrQueryRequest;

/**
 * Defines operations for resolving {@link Templates} instances used to transform incoming XML content.
 * 
 * @author Laurens Fridael
 * 
 */
public interface TemplatesResolver {
	/**
	 * Resolves a {@link Templates} instance using the given {@link SolrQueryRequest} and {@link ContentStream}.
	 * 
	 * @param request
	 * @param contentStream
	 * @return The matching {@link Templates} instance or null if no match could be found.
	 * @throws IOException
	 */
	public Templates resolveTemplates(SolrQueryRequest request, ContentStream contentStream) throws IOException;
}
